Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: e2e tests #343

Merged
merged 30 commits into from
Jan 30, 2024
Merged

test: e2e tests #343

merged 30 commits into from
Jan 30, 2024

Conversation

bee344
Copy link
Contributor

@bee344 bee344 commented Jan 8, 2024

Description

These are E2E tests that run using zombienet and the scripts located in the .\scripts\ folder. The goal of these tests is to build asset transfers using the ATA and submit them, and then checking for the success of these transfers.

Layout

The files necessary to run the tests are located in the .'e2e\ directory, with the exception of the setup scripts that are located on .\scripts\.

The tests are located in the .\e2e\tests\ folder. It contains the functions for the foreign-assets. assets, balances and pool-assets tests, The tests parameters are defined in the .\e2e\tests\index.ts file, as a TestGroups implementation, which is an interface grouping IndividualTest implementations. Each IndividualTest consists of the name of the test to be run, the args to be passed to the test, and the verification data to check the success of the transfer.

The file .\e2e\balance.ts contains the function balanceTracker which handles the storing of the inital and final balances of an account for certain assetIds as an IBalance instance. This data is later used by the verificator to check the success of the transfer.

The file .\e2e\verification.ts contains the function verification which takes an instance of IBalance corresponding to the transfer's destination account, the assetIds and the amounts transferred and checks that the transferred amounts correlate with the destination account's final balance.

The file .\e2e\logger.ts contains functions tasked with displaying the evolution of the tests in a nice way.

The file .\e2e\ consts.ts contains constants that are used during the tests.

The file .\e2e\executor.ts handles the execution of the tests, retrieving the cli arguments that specify which particular test is being run, and retrieving the necessary data from the .\e2e\tests\index.ts file in order to run the test and verify its correct completion.

The tests also rely on two shell scripts, .\e2e\zombienet.sh and .\e2e\tests.sh. The former determines which OS the program is being run on, modifies the name of the zombienet executable accordingly and runs the zombienet. The latter handles the execution of the test itself, by determining which script is needed to run and running the corresponding setup script first and the corresponding test later.

Other changes

  • Changed Signed Extension ChargeTransactionPayment by ChargeAssetTxPayment to prevent compatibility issues with latest versions.
  • Added ROCOCO_ASSET_HUB_SPEC_NAME to src/registry/Registry.ts so that it is recognized as a SystemChain.

Closes #311

@bee344 bee344 changed the title added e2e tests test: e2e tests Jan 8, 2024
@bee344 bee344 changed the title test: e2e tests test: e2e tests [WIP] Jan 8, 2024
@bee344 bee344 changed the title test: e2e tests [WIP] test: e2e tests Jan 12, 2024
@bee344 bee344 marked this pull request as ready for review January 12, 2024 20:10
@TarikGul TarikGul self-requested a review January 26, 2024 16:51
e2e-tests/README.md Outdated Show resolved Hide resolved
e2e-tests/README.md Outdated Show resolved Hide resolved
e2e-tests/README.md Outdated Show resolved Hide resolved
e2e-tests/balance.ts Outdated Show resolved Hide resolved
e2e-tests/executor.ts Outdated Show resolved Hide resolved
e2e-tests/executor.ts Outdated Show resolved Hide resolved
e2e-tests/executor.ts Outdated Show resolved Hide resolved
Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, amazing PR. There are a few nits below to be cleaned up. Also if we could add a brief description to the PR saying what was added changed etc.

@bee344 bee344 requested a review from TarikGul January 30, 2024 13:23
Copy link
Member

@TarikGul TarikGul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Amazing job!

@bee344 bee344 merged commit 7d5de87 into main Jan 30, 2024
6 checks passed
@bee344 bee344 deleted the anp-e2e branch January 30, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E2E tests that are testing on our zombienet network
2 participants